import request from '@/utils/request'

// 生成课表
export function generateSchedule(data) {
  return request({
    url: '/academic/schedule/generate',
    method: 'post',
    data: data
  })
}

// 检查课程冲突（单个）
export function checkConflict(data) {
  return request({
    url: '/academic/schedule/check-conflict',
    method: 'post',
    data: data
  })
}

// 批量检查课程冲突
export function batchCheckConflicts(data) {
  return request({
    url: '/academic/schedule/batch-check-conflicts',
    method: 'post',
    data: data
  })
}

// 调整课程安排
export function adjustSchedule(data) {
  return request({
    url: '/academic/schedule/adjust',
    method: 'put',
    data: data
  })
}

// 获取可用时间槽
export function getAvailableSlots(query) {
  return request({
    url: '/academic/schedule/available-slots',
    method: 'get',
    params: query
  })
}

// 获取课表统计信息
export function getScheduleStatistics(query) {
  return request({
    url: '/academic/schedule/statistics',
    method: 'get',
    params: query
  })
}

// 执行智能排课
export function intelligentSchedule(semesterId) {
  return request({
    url: '/academic/schedule/intelligent/' + semesterId,
    method: 'post'
  })
}

// 验证课表
export function validateSchedule(data) {
  return request({
    url: '/academic/schedule/validate',
    method: 'post',
    data: data
  })
}

// 导出课表
export function exportSchedule(query) {
  return request({
    url: '/academic/schedule/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  })
}

// 重置课表
export function resetSchedule(data) {
  return request({
    url: '/academic/schedule/reset',
    method: 'post',
    data: data
  })
}